﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Grizzy_X
{
    public abstract class CLayer
    {
        protected int ID;
        
        protected string Path;
        public string Name;
        public enum LayerType { CPointLayer, CLineLayer, CPolygonLayer, CTextLayer,BaseLayer };
        public LayerType Layer_Type;
        public bool bSelected;
        public bool bVisible;
        public string Description;
        public List<string[]> AttriFields;

        public string GetName
        {
            get
            {
                return Name;
            }
        }
        public int GetID()
        {
            try
            {
                return ID;
            }
            catch
            {
                return 0;   //ID从1开始记录，用0来标示错误。
            }
        }

        public string GetPath()
        {
            try
            {
                return Path;
            }
            catch
            {
                return "error";
            }
        }

        public bool Change_Name(string newname)
        {
            try
            {
                this.Name = newname;
                return true;
            }
            catch
            {
                return false;
            }
        }
    }
}
